<!doctype html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>补录数据-信息补录-危险性评估tab</title>
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <script src="/static/js/common/common.js" type="text/javascript"></script>
    <link href="/webjars/miniui/css/demo.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/default.css" rel="stylesheet" type="text/css" />
    <style>
        .discell {
            text-align:right;
            width:150px;
        }
        .input {
            width:100px;
        }
        table {
            border-collapse:separate;
            border-spacing:10px;
        }
    </style>
</head>
<body>
<div class="mini-fit" style="padding-top:20px;margin-bottom:45px;">
    <!-- 用户 编辑框START-->
    <form id="form1" method="post">
        <input name="id" id="id" class="mini-hidden" value="${id!''}" readonly />
        <input name="priNum" id="priNum" class="mini-hidden" value="${priNum!''}" readonly />
        <table align="center" cellspacing="8">
            <tr>
                <td style="font-weight: bold">出监、危险性评估</td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>是否特赦:</td>
                <td class="input">
                    <input name="amnesty" id="amnesty" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${amnesty!'2'}" required="true" onvaluechanged="teshe()" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>服刑期间再犯罪:</td>
                <td>
                    <input name="zfz" id="zfz" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${zfz!'2'}" required="true" onvaluechanged="zaifanzui()" />
                </td>
            </tr>
            <tr>

                <td class="discell"><font color="#dc143c">*</font>死亡:</td>
                <td>
                    <input name="death" id="death" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${death!'2'}" required="true" onvaluechanged="siwang()" />
                </td>
                <td class="discell" hidden="hidden"><font color="#dc143c">*</font>转入社区矫正:</td>
                <td colspan="3" hidden="hidden">
                    <input name="zrsqjz" id="zrsqjz" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${zrsqjz!'2'}" required="true" onvaluechanged="zhuanru()" />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>是否五涉:</td>
                <td>
                    <input name="wushe" id="wushe" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${wushe!'2'}" required="true"
                           onvaluechanged="onIsChange('wushe')" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>是否四史:</td>
                <td colspan="2">
                    <input name="sishi" id="sishi" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${sishi!'2'}" required="true"
                           onvaluechanged="onIsChange('sishi')" />
                </td>
            </tr>
            <tr id="wusheshow" style="display: none">

                <td colspan="2" id="noshow1"></td>
                <td colspan="2" id="wsshow" class="discell">
                    <input class="mini-checkbox" text="涉恐" id="shekong" name="shekong" value="${shekong!''}">
                    <input class="mini-checkbox" text="涉邪" id="shexie" name="shexie" value="${shexie!''}">
                    <input class="mini-checkbox" text="涉毒" id="shedu" name="shedu" value="${shedu!''}">
                    <input class="mini-checkbox" text="涉枪" id="sheqiang" name="sheqiang" value="${sheqiang!''}">
                    <input class="mini-checkbox" text="涉黑恶" id="shehei" name="shehei" value="${shehei!''}">
                </td>
                <td colspan="2" id="sshow" class="discell">
                    <input class="mini-checkbox" text="袭警史" id="xijing" name="xijing" value="${xijing!''}">
                    <input class="mini-checkbox" text="逃脱史" id="taotuo" name="taotuo" value="${taotuo!''}">
                    <input class="mini-checkbox" text="吸毒史" id="drughis" name="drughis" value="${drughis!''}">
                    <input class="mini-checkbox" text="自杀史" id="zisha" name="zisha" value="${zisha!''}">
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>改造表现:</td>
                <td>
                    <input name="gaizao" id="gaizao" class="mini-combobox"
                           data="[{ id: 1, name: '好' },{ id: 2, name: '较好' },{ id: 3, name: '一般' }
                           ,{ id: 4, name: '较差' },{ id: 5, name: '差' }]"
                           textField="name" valueField="id" value="${gaizao!'1'}" required="true" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>认罪态度:</td>
                <td>
                    <input name="renzui" id="renzui" class="mini-combobox"
                           data="[{ id: 1, name: '认罪服法' },{ id: 2, name: '服管不认罪' },{ id: 3, name: '不认罪不服管' }]"
                           textField="name" valueField="id" value="${renzui!'1'}" required="true" />
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold" class="discell">改造表现附件:</td>
                <td colspan="3" style="font-size: 12px;font-weight: bold">
                    <input type="button" value="上传文件" onclick="onFileUpload('gz')">
                    <span id="msg"></span>
                    <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>
                    <#if "${localCode !''}"=='140000'>
                        心理健康状况:
                    <#else>
                        是否心理健康:
                    </#if>
                </td>
                <td>
                    <input name="xinli" id="xinli" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${xinli!'2'}" required="true" />
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold" class="discell">心理健康附件:</td>
                <td colspan="3" style="font-size: 12px;font-weight: bold">
                    <input type="button" value="上传文件" onclick="onFileUpload('xl')" />
                    <span id="msg1"></span>
                    <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                </td>

            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>家庭联系情况:</td>
                <td>
                    <input name="lianxi" id="lianxi" class="mini-combobox"
                           data="[{ id: 1, name: '家庭有联系' },{ id: 2, name: '家庭无联系' },{ id: 3, name: '离异' }]"
                           textField="name" valueField="id" value="${lianxi!'2'}" required="true" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>是否办理保外就医:</td>
                <td>
                    <input name="baowaijiuyi" id="baowaijiuyi" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${baowaijiuyi!'2'}" required="true" />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>是否三无:</td>
                <td>
                    <input name="sanwu" id="sanwu" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${sanwu!'2'}" required="true"
                           onvaluechanged="onIsChange('sanwu')" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>是否三假:</td>
                <td>
                    <input name="sanjia" id="sanjia" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${sanjia!'2'}" required="true"
                           onvaluechanged="onIsChange('sanjia')" />
                </td>
            </tr>
            <tr id="sanwushow" style="display:none">
                <td colspan="2" id="noshow" class="discell">
                <td colspan="2" id="swshow" class="discell">
                    <input class="mini-checkbox" text="无家可归" name="wujia" id="wujia" value="${wujia!''}">
                    <input class="mini-checkbox" text="无亲可投" name="wuqin" id="wuqin" value="${wuqin!''}">
                    <input class="mini-checkbox" text="无业可就" name="wuye" id="wuye" value="${wuye!''}">
                </td>
                <td colspan="2" id="sjshow" class="discell">
                    <input class="mini-checkbox" text="假姓名" name="jxm" id="jxm" value="${jxm!''}">
                    <input class="mini-checkbox" text="假身份" name="jsf" id="jsf" value="${jsf!''}">
                    <input class="mini-checkbox" text="假住址" name="jhj" id="jhj" value="${jhj!''}">
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>
                    <#if "${localCode !''}"=='140000'>
                        是否有再犯罪倾向:
                    <#else>
                        是否有违法犯罪倾向:
                    </#if>
                </td>
                <td>
                    <input name="weifa" id="weifa" class="mini-combobox"
                           data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]"
                           textField="name" valueField="id" value="${weifa!''}" required="true" onvaluechanged="onIsChange('weifa')" />
                </td>
                <td class="discell">案犯类别:</td>
                <td>
                    <input name="Aftype" id="Aftype" class="mini-combobox"
                           data="[{ id: 1, name: '危害国家安全罪犯' },{ id: 2, name: '重大刑事犯' },{ id: 3, name: '一般刑事犯' }]"
                           textField="name" valueField="id" value="${Aftype!'3'}" required="true" <#--onvaluechanged="onIsChange('weifa')"-->
                           readonly />
                </td>
            </tr>
            <tr>
                <td class="discell">综上危险性评估为:</td>
                <td colspan="3">
                    <input name="pinggu" id="pinggu" class="mini-combobox" <#--readonly="true"-->
                           data="[{ id: '01', name: '重点帮教对象' },{ id: '02', name: '一般帮教对象' }]"
                           textField="name" valueField="id" value="${pinggu!'02'}" readonly />
                    <a id="autoShow" style="color: red;font-weight: bold"></a>
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>是否重大疾病、残疾:</td>
                <td>
                    <input name="canji" id="canji" class="mini-combobox"
                           data="[{ id: '1', name: '是' },{ id: '2', name: '否' }]"
                           textField="name" valueField="id" value="${canji!''}" required="true" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>有无固定住所:</td>
                <td>
                    <input name="gdzs" id="gdzs" class="mini-combobox" required="true"
                           data="[{ id: '0', name: '有' },{ id: '1', name: '无' }]"
                           textField="name" valueField="id" value="${gdzs!'0'}" required="true" showNullItem='false' />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>社会交往:</td>
                <td>
                    <input name="shjw" id="shjw" class="mini-combobox" required="true"
                           textField="text" valueField="id" emptyText="请选择..." value="${shjw!''}"
                           url="/search/code/native?1=1&codeType=1_53&pcodeId=-1" showNullItem='false' />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>家庭变化:</td>
                <td colspan="3">
                    <input class="mini-textarea" required="true" style="width: 480px" emptyText="请输入..." id="jtbh" name="jtbh" value="${jtbh!''}" />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>刑释后可能遇到的困难:</td>
                <td colspan="3">
                    <input class="mini-textarea" required="true" style="width: 480px" emptyText="请输入..." id="xshkn" name="xshkn"
                           value="${xshkn!''}" />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>初步帮教、救助建议:</td>
                <td colspan="3">
                    <input class="mini-textarea" required="true" style="width: 480px" emptyText="请输入..." id="jiuzhujianyi" name="jiuzhujianyi"
                           value="${jiuzhujianyi!''}" />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c"></font>释放后是否戒毒:</td>
                <td>
                    <#if xd==3>
                        <input name="xd" id="xd" class="mini-combobox"
                               data="[{ id: '1', name: '是' },{ id: '2', name: '否' }]"
                               textField="name" valueField="id" value="${'是'}" required="true" enabled="false"/>
                    <#else>
                        <input name="xd" id="xd" class="mini-combobox"
                               data="[{ id: '1', name: '是' },{ id: '2', name: '否' }]"
                               textField="name" valueField="id" value="${xd!'2'}" required="true" />
                    </#if>

                </td>
            </tr>
            <tr>
                <td class="discell">是否再犯罪评估附件:</td>
                <td>
                    <input type="button" onclick="onFileUpload('cj')" value="上传" style="width: 112px" />
                    <span id="msg3"></span>
                    <div><b>支持扩展名:</b>.rar .zip .doc .docx .xls .xlsx .pdf .jpg</div>
                </td>
                <td colspan="3">
<#--                    <span class="redText">* 上传形式不限，供司法所安置帮教参考。</span>-->
                </td>
            </tr>
        </table>
    </form>
</div>
<div style="width:100%;position:absolute;bottom:0;line-height: 45px;border-top: 1px solid #dfdfdf;text-align: center">
    <a class="mini-button" id="savePinggu" iconCls="fa-save" plain="true" style="font-size: 15px" onclick="saveData()">保存</a>
</div>
<script type="text/javascript">
    mini.parse();
    var form = new mini.Form("form1");
    var sanwu = mini.get("sanwu");
    var zfz = mini.get("zfz");
    var amnesty = mini.get("amnesty");
    var death = mini.get("death");
    var zrsqjz = mini.get("zrsqjz");
    var jtbh = mini.get("jtbh");
    var xshkn = mini.get("xshkn");
    var jiuzhujianyi = mini.get("jiuzhujianyi");
    var sanjia = mini.get("sanjia");
    var wushe = mini.get("wushe");
    var sishi = mini.get("sishi");
    var priNum = mini.get("priNum");
    var priNumValue=priNum.getValue();
    var id = mini.get("id");
    var idValue = id.getValue();
    var pinggu = mini.get("pinggu");
    var Aftype = mini.get("Aftype");
    var autoShowEle = document.getElementById("autoShow");

    window.onload = function () {
        // 查询上传文件的数量
        $("#msg").text("上传成功" + ${count} + "条!")
        $("#msg1").text("上传成功" + ${count1} + "条!")
        $('#msg3').text("上传成功"+ ${count3} + "条!")
        setPingGu();
        if (zfz.getValue() == "1") {
            zaifanzui();
        } else if (death.getValue() == "1") {
            siwang();
        } else if (amnesty.getValue() == "1") {
            teshe();
        } else if (zrsqjz.getValue() == "1") {
            zhuanru();
        }
        getFxByPriNum();
    }

    function saveData() {
        //再犯罪、死亡、转入社区矫正 不进行校验
        if (zfz.getValue() == "1" || death.getValue() == "1" || zrsqjz.getValue() == "1" || amnesty.getValue() == "1") {

        } else {
            form.validate();
            if (form.isValid() == false) {
                return;
            }
        }

        if (sanwu.getValue() == 1) {
            if (mini.get("wujia").getValue() == "false"
                && mini.get("wuqin").getValue() == "false"
                && mini.get("wuye").getValue() == "false") {
                mini.alert("请选择三无信息");
                return;
            }
        }
        if (sanjia.getValue() == 1) {
            if (mini.get("jxm").getValue() == "false"
                && mini.get("jsf").getValue() == "false"
                && mini.get("jhj").getValue() == "false") {
                mini.alert("请选择三假信息");
                return;
            }
        }
        if (wushe.getValue() == 1) {
            if (mini.get("shekong").getValue() == "false"
                && mini.get("shexie").getValue() == "false"
                && mini.get("shedu").getValue() == "false"
                && mini.get("sheqiang").getValue() == "false"
                && mini.get("shehei").getValue() == "false") {
                mini.alert("请选择五涉信息");
                return;
            }
        }
        if (sishi.getValue() == 1) {
            if (mini.get("xijing").getValue() == "false"
                && mini.get("taotuo").getValue() == "false"
                && mini.get("drughis").getValue() == "false"
                && mini.get("zisha").getValue() == "false") {
                mini.alert("请选择四史信息");
                return;
            }
        }
        var data = form.getData();
        var json = mini.encode(data);
        $.ajax({
            url: "/azbj/wxxpg/save",
            data: {data: json},
            type: "post",
            success: function (success) {
                if (success.code == 1) {
                    mini.alert("保存成功");
                } else if (success.code == 4001) {
                    mini.alert("请先上传出监评估附件！");
                } else if (success.code == 5599) {
                    mini.alert(success.message);
                } else {
                    mini.alert("保存失败");
                }
            }

        });
    }

    onSanwu();
    //onSanJia();
    onWuShe();
    //onSiShi();

    //三无回显专用
    function onSanwu() {
        var sanwuValue = sanwu.getValue();
        var sanjaValue = sanjia.getValue();
        var row = document.getElementById("sanwushow");
        var swshow = document.getElementById("swshow");
        var sjshow = document.getElementById("sjshow");
        var cell3 = document.getElementById("noshow");

        if (row != null) {
            if (sanwuValue == 1 && sanjaValue == 1) {
                row.style.display = "table-row";
                swshow.style.display = "table-cell";
                sjshow.style.display = "table-cell";
                cell3.style.display = "none";
            } else if (sanwuValue == 1 && sanjaValue != 1) {
                row.style.display = "table-row";
                swshow.style.display = "table-cell";
                sjshow.style.display = "none";
                cell3.style.display = "none";
            } else if (sanwuValue != 1 && sanjaValue == 1) {
                row.style.display = "table-row";
                swshow.style.display = "none";
                sjshow.style.display = "table-cell";
                cell3.style.display = "table-cell";
            } else if (sanwuValue != 1 && sanjaValue != 1) {
                row.style.display = "none";
            }
        }
    }

    //五涉回显专用
    function onWuShe() {
        var wsvalue = wushe.getValue();
        var ssvalue = sishi.getValue();
        var row = document.getElementById("wusheshow");
        var wsshow = document.getElementById("wsshow");
        var ssshow = document.getElementById("sshow");
        var cell3 = document.getElementById("noshow1");
        if (row != null) {
            if (wsvalue == 1 && ssvalue == 1) {
                row.style.display = "table-row";
                wsshow.style.display = "table-cell";
                ssshow.style.display = "table-cell";
                cell3.style.display = "none";
            } else if (wsvalue == 1 && ssvalue != 1) {
                row.style.display = "table-row";
                wsshow.style.display = "table-cell";
                ssshow.style.display = "none";
                cell3.style.display = "none";
            } else if (wsvalue != 1 && ssvalue == 1) {
                row.style.display = "table-row";
                wsshow.style.display = "none";
                ssshow.style.display = "table-cell";
                cell3.style.display = "table-cell";
            } else if (wsvalue != 1 && ssvalue != 1) {
                row.style.display = "none";
            }
        }
    }

    function onIsChange(e) {

        if ("sanwu" == e) {
            var sanwuValue = sanwu.getValue();
            var sanjaValue = sanjia.getValue();
            var row = document.getElementById("sanwushow");
            var swshow = document.getElementById("swshow");
            var sjshow = document.getElementById("sjshow");
            var cell3 = document.getElementById("noshow");
            mini.get("wujia").setValue('false');
            mini.get("wuqin").setValue('false');
            mini.get("wuye").setValue('false');
            if (row != null) {
                if (sanwuValue == 1 && sanjaValue == 1) {
                    swshow.style.display = "table-cell";
                    sjshow.style.display = "table-cell";
                    cell3.style.display = "none";
                } else if (sanwuValue == 1 && sanjaValue != 1) {
                    row.style.display = "table-row";
                    swshow.style.display = "table-cell";
                    sjshow.style.display = "none";
                    cell3.style.display = "none";
                } else if (sanwuValue != 1 && sanjaValue == 1) {
                    swshow.style.display = "none";
                    sjshow.style.display = "table-cell";
                    cell3.style.display = "table-cell";
                } else if (sanwuValue != 1 && sanjaValue != 1) {
                    row.style.display = "none";
                }
            }
            setPingGu();
        } else if ("sanjia" == e) {
            var sanwuValue = sanwu.getValue();
            var sanjaValue = sanjia.getValue();
            var row = document.getElementById("sanwushow");
            var sjshow = document.getElementById("sjshow");
            var swshow = document.getElementById("swshow");
            var cell3 = document.getElementById("noshow");
            if (row != null) {
                if (sanjaValue == 1 && sanwuValue == 1) {
                    sjshow.style.display = "table-cell";
                    swshow.style.display = "table-cell";
                    cell3.style.display = "none";
                } else if (sanjaValue == 1 && sanwuValue != 1) {
                    row.style.display = "table-row";
                    swshow.style.display = "none";
                    sjshow.style.display = "table-cell";
                    cell3.style.display = "table-cell";
                } else if (sanjaValue != 1 && sanwuValue == 1) {
                    sjshow.style.display = "none";
                    swshow.style.display = "table-cell";
                    cell3.style.display = "none";
                } else {
                    row.style.display = "none";
                }
            }
            setPingGu();
        } else if ("wushe" == e) {
            var wsvalue = wushe.getValue();
            var ssvalue = sishi.getValue();
            var row = document.getElementById("wusheshow");
            var wsshow = document.getElementById("wsshow");
            var ssshow = document.getElementById("sshow");
            var cell3 = document.getElementById("noshow1");
            if (row != null) {
                if (wsvalue == 1 && ssvalue == 1) {
                    wsshow.style.display = "table-cell";
                    ssshow.style.display = "table-cell";
                    cell3.style.display = "none";
                } else if (wsvalue == 1 && ssvalue != 1) {
                    row.style.display = "table-row";
                    wsshow.style.display = "table-cell";
                    ssshow.style.display = "none";
                    cell3.style.display = "none";
                } else if (wsvalue != 1 && ssvalue == 1) {
                    wsshow.style.display = "none";
                    ssshow.style.display = "table-cell";
                    cell3.style.display = "table-cell";
                } else if (wsvalue != 1 && ssvalue != 1) {
                    row.style.display = "none";
                }
            }
        } else if ("sishi" == e) {
            var wsvalue = wushe.getValue();
            var ssvalue = sishi.getValue();
            var row = document.getElementById("wusheshow");
            var wsshow = document.getElementById("wsshow");
            var ssshow = document.getElementById("sshow");
            var cell3 = document.getElementById("noshow1");
            if (row != null) {
                if (ssvalue == 1 && wsvalue == 1) {
                    ssshow.style.display = "table-cell";
                    wsshow.style.display = "table-cell";
                    cell3.style.display = "none";
                } else if (ssvalue == 1 && wsvalue != 1) {
                    row.style.display = "table-row";
                    wsshow.style.display = "none";
                    ssshow.style.display = "table-cell";
                    cell3.style.display = "table-cell";
                } else if (ssvalue != 1 && wsvalue == 1) {
                    ssshow.style.display = "none";
                    wsshow.style.display = "table-cell";
                    cell3.style.display = "none";
                } else {
                    row.style.display = "none";
                }
            }
        } else if ("weifa" == e) {
            setPingGu();
        }
    }

    function onFileUpload(e) {
        if (e == "gz") {
            commonEdit("/upload/user/uploadAppendixfile/view?1=1&id=${id!''}&priNum=${priNum!''}&taskId=4",null, null, 600, 400, true, true, true, callback);
            // 回调函数
            function callback() {
                $.ajax({
                    url: "/upload/downloadAppendixFile/getCountall?1=1&priNum=${priNum!''}&taskId=4",
                    type: "get",
                    success: function (success) {
                        $("#msg").text("上传成功" + success.data + "条!");
                    }
                })
                grid.reload();
            }
        } else if (e == "xl") {
            commonEdit("/upload/user/uploadAppendixfile/view?1=1&id=${id!''}&priNum=${priNum!''}&taskId=5",null, null, 600, 400, true, true, true, callback);
            // 回调函数
            function callback() {
                $.ajax({
                    url: "/upload/downloadAppendixFile/getCountall?1=1&priNum=${priNum!''}&taskId=5",
                    type: "get",
                    success: function (success) {
                        $("#msg1").text("上传成功" + success.data + "条!");
                    }
                })
                grid.reload();
            }
        } else if (e == "cj") {
            //出监评估附件
            taskid = "1";
            var url = "/upload/user/uploadAppendixfile/view?1=1&id=${id!''}&priNum=${priNum!''}&taskId=1";
            commonEdit(url,null, null, 600, 400, true, true, true, callback);
            function callback(){
                $.ajax({
                    url: "/upload/downloadAppendixFile/getCountall?1=1&priNum=${priNum!''}&taskId=1",
                    method: 'get',
                    success: function(success){
                        $('#msg3').text("上传成功" + success.data + "条!")
                    }
                })
            }
        }
    }

    function setPingGu(e) {
        var sanwuval = sanwu.getValue();//三无
        var sanjiaval = sanjia.getValue();//三假
        var weifaval = mini.get("weifa").getValue();//是否有违法犯罪倾向
        var Aftype = mini.get("Aftype").getValue();//犯罪类型
        if (sanwuval == "1" || sanjiaval == "1" || weifaval == "1" || Aftype == "1") {
            pinggu.setValue("");
            pinggu.setValue("01");
            if (sanwuval == "1" && sanjiaval == "1" && weifaval == "1" && Aftype == "1") {
                autoShowEle.innerText = '三无、三假人员、有违法犯罪倾向，危安犯';
                return;
            }
            if (sanwuval == "1" && sanjiaval == "1" && weifaval == "1") {
                autoShowEle.innerText = '三无、三假人员、有违法犯罪倾向';
                return;
            }
            if (sanwuval == "1" && sanjiaval == "1" && Aftype == "1") {
                autoShowEle.innerText = '三无、三假人员，危安犯';
                return;
            }
            if (sanwuval == "1" && weifaval == "1" && Aftype == "1") {
                autoShowEle.innerText = '三无人员、有违法犯罪倾向，危安犯';
                return;
            }
            if (sanjiaval == "1" && weifaval == "1" && Aftype == "1") {
                autoShowEle.innerText = '三假人员、有违法犯罪倾向，危安犯';
                return;
            }
            if (sanwuval == "1" && weifaval == "1") {
                autoShowEle.innerText = '三无人员、有违法犯罪倾向';
                return;
            }
            if (sanjiaval == "1" && weifaval == "1") {
                autoShowEle.innerText = '三假人员、有违法犯罪倾向';
                return;
            }
            if (sanwuval == "1" && sanjiaval == "1") {
                autoShowEle.innerText = '三无、三假人员';
                return;
            }
            if (sanwuval == "1" && Aftype == "1") {
                autoShowEle.innerText = '三无人员、危安犯';
                return;
            }
            if (sanjiaval == "1" && Aftype == "1") {
                autoShowEle.innerText = '三假人员、危安犯';
                return;
            }
            if (weifaval == "1" && Aftype == "1") {
                autoShowEle.innerText = '有违法犯罪倾向、危安犯';
                return;
            }
            if (sanwuval == "1") {
                autoShowEle.innerText = '三无人员';
                return;
            }
            if (sanjiaval == "1") {
                autoShowEle.innerText = '三假人员';
                return;
            }
            if (weifaval == "1") {
                autoShowEle.innerText = '有违法犯罪倾向';
                return;
            }
            if (Aftype == "1") {
                autoShowEle.innerText = '危安犯';

            }
        } else {
            pinggu.setValue("");
            pinggu.setValue("02");
            autoShowEle.innerText = '';
        }
    }

    /**
     * 特赦不能编辑其他项，不进入后续的衔接流程
     */
    function teshe() {
        var amnestyValue = amnesty.getValue();
        if (amnestyValue == "1") {
            form.clear();
            $("input").attr("disabled", true);
            form.setEnabled(false);
            amnesty.enable(true);//自身可编辑
            amnesty.setValue("1");
            priNum.setValue(priNumValue);
            id.setValue(idValue);
        } else {
            $("input").attr("disabled", false);
            form.setEnabled(true);
            amnesty.setValue("2");
            death.setValue("2");
            zfz.setValue("2");
            Aftype.setValue("3");
            pinggu.setValue("02");
            mini.get("canji").setValue("2");
            mini.get("gdzs").setValue("0");
            mini.get("xd").setValue("2");
            mini.get("baowaijiuyi").setValue("2");
        }
    }
    /**
     * 再犯罪不能编辑其他项，不进入后续的衔接流程
     */
    function zaifanzui() {
        var zfzValue = zfz.getValue();
        if (zfzValue == "1") {
            zfz.setValue("1");
            priNum.setValue(priNumValue);
            id.setValue(idValue);
        } else {
            $("input").attr("disabled", false);
            form.setEnabled(true);
            amnesty.setValue("2");
            death.setValue("2");
            zfz.setValue("2");
            Aftype.setValue("3");
            pinggu.setValue("02");
            mini.get("canji").setValue("2");
            mini.get("gdzs").setValue("0");
            mini.get("xd").setValue("2");
            mini.get("baowaijiuyi").setValue("2");
        }
    }

    /**
     * 死亡不能编辑其他项，不进入后续的衔接流程
     */
    function siwang() {
        var deathValue = death.getValue();
        if (deathValue == "1") {
            form.clear();
            $("input").attr("disabled", true);
            form.setEnabled(false);
            death.enable(true);//自身可编辑
            death.setValue("1");
            priNum.setValue(priNumValue);
            id.setValue(idValue);
        } else {
            $("input").attr("disabled", false);
            form.setEnabled(true);
            amnesty.setValue("2");
            death.setValue("2");
            zfz.setValue("2");
            Aftype.setValue("3");
            pinggu.setValue("02");
            mini.get("canji").setValue("2");
            mini.get("gdzs").setValue("0");
            mini.get("xd").setValue("2");
            mini.get("baowaijiuyi").setValue("2");
        }
    }

    /**
     * 转入社区矫正不能编辑其他项，不进入后续的衔接流程
     */
    function zhuanru() {
        var zrsqjzValue = zrsqjz.getValue();
        if (zrsqjzValue == "1") {
            form.clear();
            $("input").attr("disabled", true);
            form.setEnabled(false);
            zrsqjz.enable(true);//自身可编辑
            zrsqjz.setValue("1");
            priNum.setValue(priNumValue);
            id.setValue(idValue);
        } else {
            $("input").attr("disabled", false);
            form.setEnabled(true);
            amnesty.setValue("2");
            death.setValue("2");
            zfz.setValue("2");
            Aftype.setValue("3");
            pinggu.setValue("02");
            mini.get("canji").setValue("2");
            mini.get("gdzs").setValue("0");
            mini.get("xd").setValue("2");
            mini.get("baowaijiuyi").setValue("2");
        }
    }
    function getFxByPriNum() {
        if ('${priNum!''}' != '') {
            var priNum = '${priNum!''}';
            $.ajax({
                url: '/azbj/inmates_bl/getFxByPriNum/' + priNum,
                type: 'GET',
                success: function (data) {
                    if (data.code != 1) {
                        mini.alert("请保存服刑信息");
                        var saveBnt = mini.get("savePinggu");
                        saveBnt.disable();//按钮禁用
                    }
                }
            })
        }
    }
</script>
</body>
</html>